Notes 2 12 18 Numbers as Strings with Operators Numbers as Strings with Operators as Grammars x Match Numbers as Strings as Operators with 2p To save time, grammars with grammar interpreter, with unique code like in curly brackets, trace - Grammars as data so that can edit grammars x should write syntax of an algorithm language in a separate format, where, e.g. singleton and instance errors, etc. can be found by a pre-written algorithm - Unique code like in curly brackets - parse a string, run the code and parse the rest of string x see above and below List Prolog grammar has command that: - Can parse lists (e.g. algorithms) and strings (e.g. files) - x list-based algorithms can be read in the way below and run as above - Can collect variable data from a file (given a grammar x) in similar list format to file - Tokenises file to do this - The command would interpret different types of brackets as list brackets, i.e. a(), a{} as a,[] - Grammar interpreter could parse sentences, etc. i.e. with a single line of a grammar containing List Prolog code to call. Memberr (sic) (member with record in Prolog) x expensive way of correcting the bug - Specification writing automation - E.g. algorithm for specification a(1,2,[1,2]). May satisfy specification a(1,-,[1,2]). but should also satisfy a(-,2,[1,2]). by writing an algorithm, not the specification, with positive function, by including =, with code reuser (or rcaw x) - Should diverge header of the predicate into 1,[1,2] and 2,[1,2] into two separate predicates, and then merge them unless they recurse or if greater than 1 line, in which case recall them - Therefore, code reuser database should have predicates with a minimum number of interacting variables